# 寻找作者

f1=open("sy6//唐诗.txt","r",encoding="utf-8")
x=input("诗人姓名")
while x != "":
    n = 0
    for line in f1:
        line = line.strip("\n")
        colonIndex = line.find(":")
        author = line[3:colonIndex]
        if author == x:
            n += 1
            print(line)
    if n == 0:
        print("无作品")
    else:
        print("一共{}首".format(n))
    x = input("诗人姓名")
    f1.seek(0)

f1.close()